/**
 * A PuzzleCell contains a character and integer count representing number times contained 
 * character intercept various words in data-structure. It encapsulates two instant variables 
 * including char content and int count  
 * 
 * The function prototypes are as listed below:
 * public void setCount(int newCountValue)
 * public void countUp () 
 * public void countDown ()
 * public int getCount()
 * public char getChar ()
 * public PuzzleCell clone()   
 *  
 * @author Hardik
 * 
 */
public class PuzzleCell implements Cloneable {
     
	private char content;
	private int wordCount; 

	/**
	 * Initialize PuzzleCell object with char content to given value
	 * and wordCount of object to 0 or zero.  
	 * 
	 * @param initialChar - char value to set a content of the PuzzleCell to hold 
	 * 
	 */
	public PuzzleCell(char initialChar){
		content = initialChar; 
		wordCount = 0; 
	}
	
	/**
	 * An accessor method to get the count value, an integer value indicating number of words 
	 * intersects the char hold by PuzzleCell Obj 
	 * 
	 * @return count - integer value of char in PuzzleCell obj  
	 */
	public int getCount() {
		return (wordCount); 
	}
	
	/**
	 * A modifier method to reset the count (an integer value indicating number of words 
	 * intersects the char hold by PuzzleCell Obj) by given value in parameter
	 * 
	 * @param newCountValue - integer value to reset the count
	 */
	public void setCount(int newCountValue) {
		wordCount = newCountValue; 
	}
	
	/**
	 * A modifier method to increment the count (an integer value indicating number of words 
	 * intersects the char hold by PuzzleCell Obj) value by one
	 * 
	 */
	public void countUp () {
		wordCount = wordCount + 1; 
	}
	
	/**
	 * A modifier method to decrement the count (an integer value indicating number of words 
	 * intersects the char hold by PuzzleCell Obj) value by one
	 * 
	 */
	public void countDown () {
		wordCount = wordCount - 1; 
	}
	
	/**
	 * An accessor method to access the character value hold by PuzzleCell object
	 * 
	 * @return: content - character hold by PuzzleCell obj in char value 
	 */
	public char getChar () {
		return (content); 
	}
	
	/**
	 * gives copy of PuzzleCell object
	 *
	 *@throws CloneNotSupportedException 
	 */
	public PuzzleCell clone() throws CloneNotSupportedException {
		PuzzleCell cellCopy = (PuzzleCell) super.clone();
		return (cellCopy); 
	}
}
